<div class="admin">
    <form method="post" name="myform" id="myform" action="{:U('edit',array('order_id'=>$res['order_id']))}">
        <div class="panel admin-panel">
            <div class="panel-head"><strong>订单详细信息表</strong></div>

            <table class="table table-striped">
                <tr>
                    <th>
                        订单信息
                    </th>
                    <th></th>
                    <th></th>
                </tr>
                <tr>
                    <td>
                        订单号：{$res['order_sn']}
                    </td>
                    <td>
                        支付单号：{$res['pay_sn']}
                    </td>
                    <td>
                        <switch name="res['order_state']" >
                            <case value="0">
                                状态：
                                <select name="order_state">
                                    <option value = "0">已取消</option>
                                </select>
                            </case>
                            <case value="10">
                                状态：
                                <select name="order_state">
                                    <option value = "10">待付款</option>
                                </select>
                            </case>
                            <case value="20">
                                状态：
                                <select name="order_state">
                                    <option value = "20" selected="selected">待发货</option>
                                    <option value = "30">已发货</option>
                                </select>
                            </case>
                            <case value="30">
                                状态：
                                <select name="order_state">
                                    <option value = "30">已发货</option>
                                </select>
                            </case>
                            <case value="40">
                                状态：
                                <select name="order_state">
                                    <option value = "40">已完成</option>
                                </select>
                            </case>
                        </switch>
                    </td>
                </tr>
                <tr>
                    <td>
                        订单总额：{$res['order_amount']}
                    </td>
                    <td>
                        运费：{$res['shipping_fee']}
                    </td>
                    <td>{$res['shipping_express_id']}
                        物流公司：<select name="shipping_express_id">
                                    <foreach name="express" item="v">
                                        <option value = "{$v['id']}" {$res['OrderCommon']['shipping_express_id'] == $v['id'] ? "selected='selected'" : ""}>{$v['e_name']}</option>
                                    </foreach>
                                 </select>
                    </td>
                    <td>
                        物流单号：<input name="shipping_code" value="{$res['shipping_code']}" type="text" {$res['shipping_code'] ? "disabled='true'" : ""}>
                    </td>
                </tr>
                <tr>
                    <td>
                        买家：{$res['user_name']}
                    </td>
                    <td>
                        支付方式：{$res['payment_code']}
                    </td>
                    <td>
                        下单时间：{:date('Y-m-d H:i:s',$res['add_time'])}
                    </td>
                    <td>
                        付款时间：{:date('Y-m-d H:i:s',$res['payment_time'])}
                    </td>
                </tr>
            </table>

            <table class="table table-striped">
                <tr>
                    <th style="width: 500px;">
                        收货人信息
                    </th>
                    <th></th>
                    <th></th>
                </tr>
                <tr>
                    <td>
                        姓名：{$res['OrderCommon']['reciver_info']['true_name']}
                    </td>
                    <td>
                        电话：{$res['OrderCommon']['reciver_info']['mob_phone']}
                    </td>
                    <td>
                        地址：{$res['OrderCommon']['reciver_info']['area_info']}{$res['OrderCommon']['reciver_info']['address']}
                    </td>
                </tr>

            </table>

            <table class="table table-striped">
                <tr>
                    <th>商品详情</th>
                    <th>商品名称</th>
                    <th>单价</th>
                    <th>实际付款金额</th>
                    <th>数量</th>
                    <th>佣金比例</th>
                    <th>实际收款</th>
                </tr>
                <tr>
                    <foreach name="orderGoods" item="v">
                        <td><img src="{$v['goods_image']}" width="100px"></td>
                        <td>{$v['goods_title']}<br />规格：{$v['goods_attri_info']}</td>
                        <td>{$v['goods_price']}</td>
                        <td>{$v['goods_pay_price']}</td>
                        <td>{$v['goods_num']}</td>
                        <td>{$v['commis_rate']}</td>
                        <td>{$v['goods_price'] * $v['goods_num'] - $v['goods_price'] * $v['goods_num'] * $v['commis_rate']}</td>
                    </foreach>
                </tr>

            </table>
            <div class="panel-foot text-center">
                <if condition="$res['order_state'] eq 20">
                    <div class="form-button">
                        <input class="button bg-main" type="submit" value="确认保存">
                        <button class="button bg" type="reset">取消</button>
                    </div>
                </if>
            </div>
        </div>
    </form>
</div>


<script type="text/javascript">
    $("#myform").Validform({
        tiptype: 3,
        showAllError:true,
    });
    
    $('#myform').layer({
    });

    $('#query_start_time').duxTime({
        timepicker: false,
        minDate: 0,
        format:"Y-m-d"
    });
</script>




